/*
 * @Description: 
 * @Author: wangqi
 * @Date: 2024-08-15 22:18:57
 * @LastEditTime: 2024-08-19 21:51:16
 * @LastEditAuthor: wangqi
 */
import { Injectable } from '@nestjs/common';
import { CreateUserDto } from './dto/create-user.dto';
import { UpdateUserDto } from './dto/update-user.dto';
import { ConfigService } from '@nestjs/config';
import { Env } from 'src/enum/env';

@Injectable()
export class UserService {
  constructor(private configService: ConfigService) {}

  create(createUserDto: CreateUserDto) {
    return 'This action adds a new user';
  }

  findAll() {
    // const mysql = this.configService.get(Env.mysql);
    // const port = this.configService.get(Env.port);
    // return `user 模块数据库地址：${mysql}:${port}`;

    const db = this.configService.get('db');

    return `user 读取 config/js-yaml模式 模块数据库地址：${JSON.stringify(db)}`;
  }

  findOne(id: number) {
    return `This action returns a #${id} user`;
  }

  update(id: number, updateUserDto: UpdateUserDto) {
    return `This action updates a #${id} user`;
  }

  remove(id: number) {
    return `This action removes a #${id} user`;
  }
}
